package com.ssy.lingxi.purchase.repository;

import com.ssy.lingxi.purchase.entity.quotedprice.QuotedPriceDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *采购报价单详情DAO
 */
@Repository
public interface QuotedPriceDetailsRepository extends JpaRepository<QuotedPriceDetails, Long>, JpaSpecificationExecutor<QuotedPriceDetails> {

    List<QuotedPriceDetails> findAllByQuotedPriceId(Long  quotedPriceId);

    List<QuotedPriceDetails> findAllByTurnAndQuotedPriceIdIn(Integer turn, List<Long> ids, Sort sort);

    Page<QuotedPriceDetails> findAllByQuotedPriceIdAndTurn(Long  quotedPriceId,Integer  turn, Pageable page);

    Page<QuotedPriceDetails> findAllByQuotedPriceIdAndIsPrize(Long  quotedPriceId,Integer  isPrize, Pageable page);
}
